/*! \file fdmempoptstepcondition.hpp
    \brief step condition for employee options
*/

#ifndef quantlib_fdm_emp_opt_step_condition_hpp
#define quantlib_fdm_emp_opt_step_condition_hpp

#include <ql/termstructures/yieldtermstructure.hpp>
#include <ql/methods/finitedifferences/stepcondition.hpp>
#include <ql/experimental/finitedifferences/fdmmesher.hpp>
#include <ql/experimental/finitedifferences/fdminnervaluecalculator.hpp>

namespace QuantLib {

    class FdmEmpOptStepCondition : public StepCondition<Array> {
      public:
        FdmEmpOptStepCondition(
			const Time &vestingStartTime,
			const Handle<YieldTermStructure>& employeeLossTS,
            const boost::shared_ptr<FdmMesher> & mesher,
			const boost::shared_ptr<FdmInnerValueCalculator> & calculator);

        void applyTo(Array& a, Time t) const;

		const Time &vestingStartTime() const { return vestingStartTime_; }
		const Handle<YieldTermStructure>& employeeLossRate() const { return employeeLossRate_; }
      private:
		Time vestingStartTime_;
		Handle<YieldTermStructure> employeeLossRate_;
		const boost::shared_ptr<FdmMesher> mesher_;
        const boost::shared_ptr<FdmInnerValueCalculator> calculator_;
    };
}
#endif